home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / pull20.zip / PULLSTAT.PAS < prev    next >
Pascal/Delphi Source File  |  1988-01-11  |  30KB  |  718 lines

  1. { =========================================================================== }
  2. { PullStat.pas - User Statistics for pull-down menus.       ver 2.0, 01-12-87 }
  3. {                                                                             }
  4. { This file contains all the data for GetUserPullStats, GetOverrideStats and  }
  5. { CheckGlobalKeys to configure the menus.                                     }
  6. { =========================================================================== }
  7.  
  8. {$R-,S-,I-,D-,T-,F-,V-,B-,N-,L+ }
  9.  
  10. UNIT PullStat;
  11.  
  12. INTERFACE
  13.  
  14. uses
  15.   CRT,Qwik,WndwVars,PullVars,Pull,PullDir;
  16.  
  17. { ------------------ Set up your window names here in order: ---------------- }
  18. { This is optional, but it sure helps you in not only understanding the
  19.   program, but also makes it unquestionably easier to rearrange.              }
  20.  
  21. type
  22.   MainMenuNames = (NoMainMenu,FilesMenu,ColorMenu,AutoPartsMenu,EnterDataMenu,
  23.                    OptionsMenu,UtilitiesMenu,IRSmenu,QuitMenu);
  24.   SubMenuNames  = (NoSubMenu,TiresMenu,RadioMenu,UpdateMenu,DateMenu,
  25.                    BrandsMenu);
  26.   DataWndwNames = (NoDW,BytesDW,WordsDW,IntegersDW,LongIntsDW,RealsDW,HexDW,
  27.                    CharsDW,StringsDW,PathDW,FileMaskDW,DateDW,YearDW);
  28.   HelpWndwNames = (NoHW,WorkWndwHW,TopMenuHW,FilesMenuHW,DirectoryMenuHW,
  29.                    BrandsMenuHW,EnterDataMenuHW,IRSmenuHW,DateMenuHW,
  30.                    UpdateMenuHW,ExecChoiceHW,SingleChoiceHW,MultipleChoiceHW,
  31.                    NumericHW,TextHW);
  32.   HelpLineNames = (NoHL,               { HL - HelpLine;  L  - Last }
  33.                    HLw1,HLw2,HLw3,HLw4,HLw5,HLw6,  { Work window }
  34.                    HLw7,HLw8,HLw9,HLw10,HLwL,
  35.                    HLt1,HLtL,                 { Top menu }
  36.                    HLb1,HLb2,HLb3,HLb4,HLb5,  { Brands submenu }
  37.                    HLb6,HLb7,HLbL,
  38.                    HLf1,HLf2,HLf3,HLf4,HLf5,  { Files submenu }
  39.                    HLf6,HLf7,HLf8,HLf9,HLfL,
  40.                    HLdir1,HLdir2,HLdir3,HLdir4,HLdir5,  { Directory submenu }
  41.                    HLdir6,HLdir7,HLdir8,HLdir9,HLdirL,
  42.                    HLe1,HLe2,HLe3,HLe4,HLe5,  { Enter data submenu }
  43.                    HLe6,HLe7,HLe8,HLe9,HLe10,
  44.                    HLe11,HLe12,HLe13,HLe14,HLeL,
  45.                    HLi1,HLi2,HLiL,            { IRS menu }
  46.                    HLd1,HLd2,HLd3,HLdL,       { Date submenu }
  47.                    HLu1,HLu2,HLuL,            { Update submenu }
  48.                    HLx1,HLx2,HLxL,            { eXecute choice menu }
  49.                    HLs1,HLs2,HLsL,            { Single choice menu }
  50.                    HLm1,HLm2,HLmL,            { Multiple choice menu }
  51.                    HLn1,HLn2,HLnL,            { Numeric data entry window }
  52.                    HLtx1,HLtx2,HLtxL);        { Text data entry window }
  53. { Careful! - Always test your last main menu, submenu, data window, and help
  54.   window for run-time error!  It makes sure you have allotted enough memory
  55.   with your constants.  The compiler cannot check it with these typed scalars.}
  56.  
  57. procedure GetUserPullStats;
  58. procedure GetOverrideStats;
  59. procedure CheckGlobalKeys;
  60.  
  61.  
  62. IMPLEMENTATION
  63.  
  64. { ************************ GetUserPullStats ********************************* }
  65. { The major configurations for all menus go here.  The program first clears   }
  66. { all RECORD values to $00.  The values below will set new values. Therefore, }
  67. { setting RECORD values to "false" or the like is not necessary.              }
  68. { --------------------------------------------------------------------------- }
  69.  
  70. procedure GetUserPullStats;
  71. begin
  72.   LocationWarning:=true;   { If true and a Submenu won't fit, a message is
  73.                              displayed.  (It says "Too many Windows", but this
  74.                              will be changed next time.)  If false, you can
  75.                              override the location without the message. }
  76.  
  77.   { ------------------ Set up your colors and borders here: ---------------- }
  78.   TopMenuAttr:=  black+LightGrayBG;  TopMenuHattr:= white+BlackBG;
  79.  
  80.   MainMenuBattr:=lightgray+BlackBG;
  81.   MainMenuHattr:=black+LightGrayBG;  MainMenuLattr:=yellow+BlackBG;
  82.   MainMenuCattr:=lightgray+BlackBG;
  83.  
  84.   SubMenuWattr:= black+CyanBG;       SubMenuBattr:= black+CyanBG;
  85.  
  86.   if VideoMode=7 then
  87.     begin
  88.       TopMenuLattr :=TopMenuAttr;
  89.       MainMenuWattr:=lightgray+BlackBG;
  90.       SubMenuHattr :=black    +LightGrayBG;
  91.       SubMenuLattr :=white    +BlackBG;
  92.       SubMenuCattr :=lightgray+BlackBG;
  93.     end
  94.   else
  95.     begin
  96.       TopMenuLattr :=red  +LightGrayBG;
  97.       MainMenuWattr:=white+BlackBG;
  98.       SubMenuHattr :=white+BlueBG;
  99.       SubMenuLattr :=white+CyanBG;
  100.       SubMenuCattr :=blue +CyanBG;
  101.     end;
  102.  
  103.   DataWndwWattr:=black+BrownBG;     DataWndwBattr:=black+BrownBG;
  104.   HelpWndwWattr:=black+GreenBG;     HelpWndwBattr:=black+LightGrayBG;
  105.   MsgLineAttr  :=green+BlackBG;     KeyStatusAttr:=black+GreenBG;
  106.  
  107.   Brdr[UserBrdr1].BrdrArray:='╒═╕││└─┘╞═╡╤│┴╪';
  108.   MainMenuBrdr:=UserBrdr1;              SubMenuBrdr :=SingleBrdr;
  109.   DataWndwBrdr:=HdoubleBrdr;            HelpWndwBrdr:=HdoubleBrdr;
  110.   HelpWndwModes:=ZoomMode+ShadowRight;
  111.   RowsBelowHelp:=4;                     RowsBelowMsg:=0;
  112.  
  113.   { ------------------------- Top Menu defaults ----------------------------- }
  114.   TopMenuRow:=2;        { Top menu to appear on row 2 }
  115.   MPulled:=3;           { Main menu title to be HiLited when F10 is pressed. }
  116.   MoreCmdSeq:='ATB';    { Sequence of command letter(s) as if keyed in.  This }
  117.                         { will be the default menu(s) pulled. }
  118.   PullDown:=false;      { Set this true if you want the command sequence}
  119.                         {  to pull down the menus at startup. }
  120.  
  121.   { ------------------- Set up your MainMenu records here: ------------------ }
  122.   MainMenuRow:=3;       { First row of Main menus to appear on screen row 3 }
  123.   with MainMenu[ord(FilesMenu)] do
  124.   begin
  125.     MenuMode:=ExecSingleChoice; SingleFlagLine:=5;
  126.     Title:='Files';
  127.     Line[1]:='Path';               LineMode[1]:=ToDataWndw;
  128.                                    LinkNum [1]:=ord(PathDW);
  129.     Line[2]:='Mask for Directory'; LineMode[2]:=ToDataWndw;
  130.                                    LinkNum [2]:=ord(FileMaskDW);
  131.     Line[3]:='Directory';          LineMode[3]:=ToUserWndw;
  132.     Line[4]:='──────────────────'; LineMode[4]:=Comment;
  133.     Line[5]:='Merge';
  134.     Line[6]:='make Backup';
  135.     Line[7]:='text Out';
  136.     Line[8]:='';                   LineMode[8]:=Partition;
  137.     Line[9]:='Help comment';       LineMode[9]:=Comment;
  138.     MenuLines:=9;                  DefaultLine:=3;
  139.     MsgLineNum:=3;                 HelpWndwNum:=ord(FilesMenuHW);
  140.   end;
  141.   with MainMenu[ord(ColorMenu)] do
  142.   begin
  143.     MenuMode:=SingleChoice;     SingleFlagLine:=2;
  144.     Title:='Color';
  145.     Line[1]:='Blue';
  146.     Line[2]:='Green';
  147.     Line[3]:='Orange';
  148.     Line[4]:='Yellow';
  149.     Line[5]:='Red';
  150.     Line[6]:='Cyan';
  151.     Line[7]:='Ultraviolet';
  152.     MenuLines:=7;               DefaultLine:=5;
  153.     MsgLineNum:=3;              HelpWndwNum:=ord(SingleChoiceHW);
  154.   end;
  155.   with MainMenu[ord(AutoPartsMenu)] do
  156.   begin
  157.     MenuMode:=MultipleChoice;
  158.     Title:='AutoParts';
  159.     Line[1]:='Tires';           LineMode[1]:=ToSubMenu;
  160.                                 LinkNum [1]:=ord(TiresMenu);
  161.     Line[2]:='Radio';           LineMode[2]:=ToSubMenu;
  162.                                 LinkNum [2]:=ord(RadioMenu);
  163.     Line[3]:='Seats';           LineMode[3]:=ToDataWndw;
  164.                                 LinkNum [3]:=ord(BytesDW);
  165.     Line[4]:='Mirrors';         Flagged[4]:=true;
  166.     Line[5]:='Locks';
  167.     Line[6]:='HiBeams';         Flagged[6]:=true;
  168.     Line[7]:='Wheels';
  169.     MenuLines:=7;               DefaultLine:=1;
  170.     MsgLineNum:=3;              HelpWndwNum:=ord(MultipleChoiceHW);
  171.   end;
  172.   with MainMenu[ord(EnterDataMenu)] do
  173.   begin
  174.     MenuMode:=MultipleChoice;
  175.     Title:='EnterData';
  176.     Line[1]:='Byte';            LineMode[1]:=ToDataWndw;
  177.                                 LinkNum [1]:=ord(BytesDW);
  178.     Line[2]:='Word';            LineMode[2]:=ToDataWndw;
  179.                                 LinkNum [2]:=or